package com.opensky.qatest.util.junit;

import com.opensky.qatest.ui.component.IComponent;
import com.opensky.qatest.ui.page.IPage;
import com.opensky.qatest.util.common.LogicUtils;
import com.opensky.qatest.util.selenium.Report;

public class Assert extends junit.framework.Assert {

    public static void assertUrlEqual(String expected, String actual) {
	Assert.assertTrue(Report.wrongURL(expected, actual), LogicUtils.isURLEqual(expected, actual));
    }

    public static void assertPageLoaded(IPage page, String comment) {
	assertNotNull(Report.notLoaded(comment), page);
	assertTrue(Report.notLoaded(page.getName()), page.isPageLoaded());
    }

    public static void assertComponentLoaded(IComponent component, String comment) {
	assertNotNull(Report.notLoaded(comment), component);
	assertTrue(Report.notLoaded(component.getName()), component.isComponentLoaded());
    }
}
